﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace FinWeb3.Models.Helpers
{
    public static class DateTimeExtensions
    {
        public static DateTime FirstDay(this DateTime date)
        {
            return new DateTime(date.Year, date.Month, 1);
        }

        public static DateTime LastDay(this DateTime date)
        {
            return new DateTime(date.Year, date.Month, 1).AddMonths(1).AddDays(-1);
        }

        public static string ToDateId(this DateTime date)
        {
            return date.ToString("ddMMyyyy");
        }
    }
}
